home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / auror300.zip / SYNCH.AML < prev    next >
Text File  |  1996-07-17  |  2KB  |  65 lines

  1. //--------------------------------------------------------------------
  2. // SYNCH.AML
  3. // Synchronized Scrolling, (C) 1993-1996 by nuText Systems
  4. //
  5. // This macro toggles synchronized scrolling On/Off.
  6. //
  7. // When synchronized scrolling is On, all windows will be scrolled by
  8. // the same amount as the topmost window. Only windows of the same type
  9. // as the topmost window (i.e. edit, fmgr) will be scrolled.
  10. //
  11. // Usage:
  12. //
  13. // Select this macro from the Macro List (on the Macro menu), or run it
  14. // from the macro picklist <shift f12>.
  15. //--------------------------------------------------------------------
  16.  
  17. include bootpath "define.aml"
  18.  
  19. // check for a previous install
  20. if prf.sync then
  21.   destroytimer 'sync'
  22.   destroyobject prf.sync
  23.   destroyvar "sync" "prf"
  24.   display
  25.   say "Synchronized scrolling Off "
  26.   return
  27. end
  28. prf.sync = getcurrobj
  29.  
  30.  
  31. // edit/fmgr windows only
  32. object "edit_fmgr"
  33.  
  34. variable lastwin, lastx, lasty
  35.  
  36. // called when the display is updated
  37. event <display>
  38.   if lastwin == getcurrwin then
  39.     xoffset = getviewleft - lastx
  40.     yoffset = getviewtop - lasty
  41.     if xoffset or yoffset then
  42.       window = getprevwin
  43.       while window do
  44.         if wintype? (getwinobj lastwin) window then
  45.           rollcol xoffset window
  46.           rollrow yoffset window
  47.         end
  48.         window = getprevwin window
  49.       end
  50.     else
  51.       return
  52.     end
  53.   else
  54.     lastwin = getcurrwin
  55.   end
  56.   lastx = getviewleft
  57.   lasty = getviewtop
  58. end
  59.  
  60. // keep this macro resident
  61. resident ON
  62.  
  63. display
  64. say "Synchronized scrolling On "
  65.